package com.ybkj.chat.module.dynamic.fragment;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.entity.MultiItemEntity;
import com.ybkj.chat.R;
import com.ybkj.chat.base.BaseMvpFragment;
import com.ybkj.chat.bean.Expand1Item;
import com.ybkj.chat.bean.ExpandItem;
import com.ybkj.chat.module.dynamic.adapter.PickCreatAdapter;
import com.ybkj.chat.ui.view.recyclerview.XRecyclerView;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 选人创建群聊9.5  tab1
 */
public class PickCreatFragment extends BaseMvpFragment {

    @BindView(R.id.irc)
    XRecyclerView irc;

    private PickCreatAdapter mPickCreatAdapter;

    @Override
    protected void injectPresenter() {

    }

    @Override
    protected void initView() {
        mPickCreatAdapter = new PickCreatAdapter(getExpandListData(4));
        mPickCreatAdapter.openLoadAnimation(BaseQuickAdapter.ALPHAIN);
        irc.setAdapter(mPickCreatAdapter);
        mPickCreatAdapter.expandAll(0, true);
    }

    @Override
    protected void initData() {

    }

    @Override
    public int getLayoutId() {
        return R.layout.fragment_pick_creat;
    }

    @Override
    protected String getSimpleNme() {
        return null;
    }


    private List<MultiItemEntity> getExpandListData(int count) {
        int lvCount = count;
        int lv1Count = 6;

        List<MultiItemEntity> data = new ArrayList<>();
        for (int i = 0; i < lvCount; i++) {
            ExpandItem item0 = new ExpandItem("最近联系人" + i);
            for (int k = 0; k < lv1Count; k++) {
                item0.addSubItem(new Expand1Item(" Blanche" + k));
            }
            data.add(item0);
        }
        return data;
    }


}
